<?php

namespace App\Http\Middleware;


use Closure;
use EasyWeChat\Foundation\Application;

//活动分享 微信jssdk
class WeiXinJSSDK
{

    public function handle($request, Closure $next)
    {

        $app = new Application(config('app.weixin_options'));
        view()->share('js', $app->js);

        //前台调用方式
        /*
        <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" charset="utf-8">
            wx.config(<?php echo $js->config(array('onMenuShareQQ', 'onMenuShareWeibo'), true) ?>);
        </script>
        */
        return $next($request);

    }

}
